#ifndef BIGINT_H
	#define BIGINT_H

	#include <algorithm> 
	#include <fstream>

	struct BigInt{
	
	public:        
		BigInt(size_t size_ = 10);

		BigInt(int * src, size_t size_, bool negative);
		
		BigInt(BigInt const & bi);		
		
		BigInt(std::string const & str);

		~BigInt();

		BigInt & operator=(BigInt const & bi);		

		void swap(BigInt & bi);
		
		int isBigger(BigInt const & bi) const;
		
		void addAbs(BigInt const & b1, BigInt const & b2);		
		
		void subAbs(BigInt const & b1, BigInt const & b2);

		BigInt & smul(BigInt const & b1, BigInt const & b2, size_t i);

		BigInt & operator+= (BigInt const & b1);

		BigInt & operator-= (BigInt const & b2);

		BigInt & operator*= (BigInt const & b2) ;

		BigInt & operator*= ( int i );
	
	    size_t size() const;

	    int * data() const;

	    int data(size_t pos) const;

	    bool isNegative() const;

		void setNegative(bool negative);

	private:	
		size_t size_;
		int * data_;		
		bool isNegative_;

	 	void update(int * src, size_t size_, bool negative);
		BigInt & shift(size_t i);

	};
	std::ofstream & operator<< (std::ofstream & out, BigInt & n);
	BigInt & operator+ ( BigInt const & b1, BigInt const & b2);
	BigInt & operator- ( BigInt const & b1, BigInt const & b2);
	BigInt & operator* ( BigInt const & b1, BigInt const & b2);
	BigInt & operator* ( BigInt const & b1, int i);
#endif
